package com.lcxw.hxzbapi.dao.mapper;

import java.util.List;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import com.lcxw.hxzbapi.entity.pojo.VipLevel;

@Mapper
public interface VipLevelMapper {

    @Delete({
        "delete from ywpd_viplevel",
        "where `id` = #{id,jdbcType=INTEGER}"
    })
    int deleteByPrimaryKey(Integer id);

    @Insert({
        "insert into ywpd_viplevel (`level`, `name`, `picUrl`, ",
        "`min`, `max`)",
        "values (#{level}, #{name}, #{picUrl}, ",
        "#{min}, #{max})"
    })
    int insert(VipLevel record);

    @Select({
        "select",
        "*",
        "from ywpd_viplevel",
        "where `id` = #{id}"
    })
    VipLevel selectByPrimaryKey(int id);

    @Select("SELECT * FROM ywpd_viplevel")
    List<VipLevel> selectAll();

    @Update({
        "update ywpd_viplevel set ",
        "`level` = #{level},",
        "`name` = #{name},",
        "`picUrl` = #{picUrl},",
        "`min` = #{min},",
        "`max` = #{max}",
        "where `id` = #{id}"
    })
    int updateByPrimaryKey(VipLevel record);
}
